package com.xiaoge.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.PayloadApplicationEvent;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @author <a href="mailto:1330137071@qq.com">Zhang Xiao</a>
 * @since
 */
@Service
public class UserService {

	@Autowired // todo 事件广播器
	private ApplicationEventMulticaster applicationEventMulticaster;

	public void test() {
		// todo 发布事件
		applicationEventMulticaster.multicastEvent(new PayloadApplicationEvent<String>(this, "222"));
		System.out.println("test");
	}

}
